<template>
    <h1>用户投资明细</h1>

    <table>
        <thead>
            <tr>
                <th>投资人登录账号</th>
                <th>投资金额</th>
                <th>投资时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in Info">
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.UI_Money }}</td>
                <td>{{ item.UI_Date }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const route = useRoute();

const Info = ref([{
    UL_Name:'',
    UI_Money:'',
    UI_Date:'',
}])

console.log(route.params.Id);

onMounted(()=>{
    ShowAllUserInvestInfo();
})

const ShowAllUserInvestInfo = ()=>{
    axios({
        method:'get',
        url:'http://localhost:63517/api/Invest/ShowAllUserInvestInfo',
        params:{
            Id:route.params.Id,
        }
    })
    .then(res=>{
        console.log(res.data);
        Info.value = res.data;
    })
    .catch(err=>{
        console.log(err);
    })
}

</script>
